import requests
# 基础url
base_url = "https://www.hbjcxy.com/jyyw/"
# 定义一个列表 存url
urls = []
# 循环
for i in range(0,5):
    if i==0:
        url = base_url+"index"+".html"
        print(url)
        urls.append(url)
    else:
        url = base_url+"index"+"_"+str(i+1)+".html"
        print(url)
        urls.append(url)
print(urls)
for i in range(len(urls)):
    # 每个url进行请求
    response = requests.get(urls[i])
    # 编码方式
    response.encoding = "utf-8"
    # 保存为文件
    with open("网页/"+str(i)+".html","w+",encoding="utf-8") as f:
        f.write(response.text)
# create_url(start_page,end_page)->none save_file(filename,html)->none do_request(url)->html